﻿<!DOCTYPE html>
<html lang="en">
<head>
    <title>宾果高校</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <link rel="stylesheet" href="../css/bootstrap.min.css">
    <link rel="stylesheet" href="../css/style.css">
    <link rel="stylesheet" href="../css/sweetalert.min.css" />
    <script src="../js/jquery-1.12.2.min.js"></script>
    <script src="../js/common.js"></script>
    <script src="../js/login.js"></script>
    <script src="../js/layer.js"></script>
    <script src="../js/angular.min.js"></script>
    <script src="../js/Controller.js"></script>
    <script src="../js/sweetalert.min.js"></script>
</head>
<body id="bodyContent">
    <div id="searchPage"></div>
    <div style="margin-top: 20px;" class="main">
        <div class="wrap">
            <div class="panel panel-default">
                <div class="panel-body" ng-app="myApp">
                    <div class="togglebar">
                        <ul class="nav nav-tabs nav-justified">
                            <li class="active"><a id="popAuditsucc">审核成功</a></li>
                            <li><a id="popAuditing">审核中</a></li>
                            <li><a id="popAuditfail">审核失败</a></li>
                        </ul>
                    </div>
                    <div style="margin-top: 5px;"></div>
                    <div ng-controller="companyProjectCtrl">
                        <div id="audit-succ">
                            <table class="table table-hover">
                                <tr>
                                    <td>企业赞助书名称</td>
                                    <td>发布状态</td>
                                    <td>发布时间</td>
                                    <td>被浏览次数</td>
                                    <td>邀请社团名称</td>
                                    <td>社团地区</td>
                                    <td>社团活动书</td>
                                    <td>社团方案</td>
                                    <td>邀请状态</td>
                                    <td>邀请时间</td>
                                    <td>确定合作</td>
                                    <td>取消邀请</td>
                                </tr>
                                <tr ng-repeat="x in names | filter:{Status:1}">
                                    <td>{{x.ProjectName}}</td>
                                    <td>{{x.Status | checkProjectStatus }}</td>
                                    <td>{{x.CreateTime | date:'yyyy-MM-dd HH:mm:ss'}}</td>
                                    <td>{{x.Readers}}</td>
                                    <td>{{x.ProItem.Association.Name}}</td>
                                    <td>{{x.ProItem.Association.ProvinceName +'-' +x.ProItem.Association.CityName+'-'+x.ProItem.Association.SchoolName}}</td>
                                    <td><a href="#" tag="{{x.ProjectNO}}" onclick="View(this, 'AssocBooks')">查看</a></td>
                                    <td><a href="#" tag="{{x.ProItem.ProjectNOSelf}}" onclick="View(this, 'AssocScheme')">查看</a></td>
                                    <td>{{x.ProItem.Status | checkProjectItemStatus}}</td>
                                    <td>{{x.ProItem.CreateTime| date:'yyyy-MM-dd HH:mm:ss'}}</td>
                                    <td>
                                        <button type="button" class="btn btn-default btn-xs" tag="{{x.ProjectNO}}" tagroleid="{{x.ProItem.IntentionRoleNO}}" tagconid="{{x.ProItem.IntentionContactNO}}" onclick="Go(this, 'ok')">确定</button>
                                    </td>
                                    <td>
                                        <button type="button" class="btn btn-default btn-xs" tag="{{x.ProjectNO}}" tagroleid="{{x.ProItem.IntentionRoleNO}}" tagconid="{{x.ProItem.IntentionContactNO}}" onclick="Go(this, 'cancel')">取消</button>
                                    </td>
                                </tr>
                            </table>
                        </div>
                        <div id="audit-ing">
                            <table class="table table-hover">
                                <tr>
                                    <td>企业赞助书名称</td>
                                    <td>审核状态</td>
                                    <td>提交时间</td>
                                </tr>
                                <tr ng-repeat="x in names | filter:{Status:0}">
                                    <td>{{x.ProjectName}}</td>
                                    <td>{{x.Status | checkProjectStatus}}</td>
                                    <td>{{x.CreateTime | date:'yyyy-MM-dd HH:mm:ss'}}</td>
                                </tr>
                            </table>
                        </div>
                        <div id="audit-fail">
                            <table class="table table-hover">
                                <tr>
                                    <td>企业赞助书名称</td>
                                    <td>审核状态</td>
                                    <td>审核时间</td>
                                    <td>失败原因</td>
                                    <td>重新发布</td>
                                </tr>
                                <tr ng-repeat="x in names | filter:{Status:4}">
                                    <td>{{x.ProjectName}}</td>
                                    <td>{{x.Status | checkProjectStatus}}</td>
                                    <td>{{x.UpdateTime | date:'yyyy-MM-dd HH:mm:ss'}}</td>
                                    <td>{{x.Remark}}</td>
                                    <td>
                                        <button type="button" class="btn btn-default btn-xs" tag="{{x.ProjectNO}}" onclick="Go(this, 'edit')">重新发布</button>
                                    </td>
                                </tr>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>
</html>
<script>

    $("#searchPage").load("header.html", function () {
        SetCss("Spon");
    });

    function View(obj, mode) {
        var id = $(obj).attr("tag");

        layer.ready(function () {

            layer.open({
                type: 2,
                title: '宾果高校',
                fix: false,
                shadeClose: true,
                maxmin: false,
                area: ['1000px', '500px'],
                content: 'Message.html?mode=' + mode + '&id=' + id,
                end: function () {

                }
            });
        });
    }

    function AfteAjax(ctx) {

        if (ctx == "" || ctx == null) {
            window.location = "../login.html";
            return;
        }

        window.location = window.self;
    }

    function Go(obj, mode) {
        var id = $(obj).attr("tag");
        var roleID = $(obj).attr("tagRoleID");
        var conID = $(obj).attr("tagconid");

        switch (mode) {
            case "ok":
                common.commonAjax({ type: 'Get', url: '../api/project/UpdateItemStaus?type=ok&id=' + id + "&roleID=" + roleID + "&conID=" + conID, sMethod: AfteAjax, alert: true, loadingCtrl: $("#bodyContent") });
                break;
            case "cancel":
                common.commonAjax({ type: 'Get', url: '../api/project/UpdateItemStaus?type=cancel&id=' + id + "&roleID=" + roleID + "&conID=" + conID, sMethod: AfteAjax, alert: true, loadingCtrl: $("#bodyContent") });
                break;
            case "edit":
                window.location = "book.aspx?id=" + id + "&mode=edit";
                break;
        }
    }

</script>